package com.itheima.stock.service.impl;


import com.itheima.stock.mapper.StockBusinessMapper;
import com.itheima.stock.pojo.StockBusiness;
import com.itheima.stock.pojo.dto.DescribDto;
import com.itheima.stock.service.StockBusinessService;
import com.itheima.stock.vo.resp.R;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 主营业务表(StockBusiness)表服务实现类
 *
 * @author GuoXinChao.126@gmail.com
 * @since 2023-03-05 01:50:08
 */
@Service("stockBusinessService")
public class StockBusinessServiceImpl implements StockBusinessService {
    @Resource
    private StockBusinessMapper stockBusinessMapper;


    @Override
    public R<DescribDto> getDescrib(String code) {
        StockBusiness stockBusiness = stockBusinessMapper.selectOneByCode(code);
        DescribDto describDto = new DescribDto();
        describDto.setBusiness(stockBusiness.getBusiness());
        describDto.setCode(stockBusiness.getSecCode());
        describDto.setName(stockBusiness.getSecName());
        describDto.setTrade(stockBusiness.getSectorName());
        return R.ok(describDto);
    }
}
